package com.sunny.design.command.ftp;

import java.util.ArrayList;
import java.util.List;

/**
 * FTP 命令接收者
 *
 * @author Sunny
 * @date 2020/3/16
 */
public class FTPController {
    private List<FTPCommand> actions = new ArrayList<>();

    public void addAction(FTPCommand command){
        actions.add(command);
    }

    public void execute(FTPCommand command){
        command.execute();
    }

    public void executes(){
        for (FTPCommand command : actions) {
            command.execute();
        }
        actions.clear();
    }
}
